package com.gupaoedu.pattern.sigleton.inner;

/**
 * @Auther: tcm
 * @Date: 2020/1/23 21:39
 * @Description:
 */
public class InnerStaticSingleton {

    private InnerStaticSingleton(){
        if(InnerClass.innerSingleton != null){
            throw new RuntimeException("不能创建多个单例！！！");
        }
    }

    public static InnerStaticSingleton getInstance(){

        return InnerClass.innerSingleton;
    }

    public static class InnerClass{

        public static final InnerStaticSingleton innerSingleton = new InnerStaticSingleton();

    }

}
